class Person:
    def __init__(self, name, age, sex):
        self.name = name
        self.age = age
        self.sex = sex
        self.mapping = []  # 如果不需要可以删除
        self.data = [f'hello, my name is {self.name} and I am {self.age} years old, sex is {self.sex}']

    def greet(self):
        print(self.data[0])  # 打印列表中的第一个元素

    def show(self):
        print(self.name,self.age)

# 创建实例并调用 greet 方法
p = Person('wangpandong', '34', '男')
p.greet()
p.show()


class ADDR:
    def __init__(self, *args):
        if len(args) == 4:
            self.Country = args[0]
            self.Province = args[1]
            self.Township = args[2]
            self.Village = args[3]
        elif len(args) == 3:
            self.Country = args[0]
            self.Province = args[1]
            self.Township = args[2]
        else:
            raise ValueError("至少需要传入三个参数")

    def greet(self):
         print((f'我来自{self.Township},它属于{self.Province}，我爱着{self.Country}'))

p1 = ADDR('中国','河南','汝州','王寨')
p2 = ADDR('中国','北京','海淀')
p1.greet()
p2.greet()

#作用，将每一列转换为小写
class BaseStationProcessor:
    def __init__(self, df):
        self.df = df
        if hasattr(df, 'lower'):
            self.df = df.lower()

s = BaseStationProcessor('wangpANdONG')
print(s.df)
